package com.sc.dal.mapper.goods;

import java.util.List;
import java.util.Map;

import com.sc.dal.model.goods.GoodsStock;

public interface GoodsStockMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(GoodsStock record);

    GoodsStock selectByPrimaryKey(Integer id);

    int updateByPrimaryKey(GoodsStock stock);
    
    /**
     * 按商品id，更新库存
     * @param stock
     * @return int
     */
    int updateByGoodsId(GoodsStock stock);
    
    int selectBaseQuantity(GoodsStock stock);
    
    int selectSaleBaseQuantity(GoodsStock stock);

    /**
     * 根据条件，查找商品货品数据
     * @param paramMap
     * @return List<GoodsStock>
     */
    List<GoodsStock> selectList(Map<String, Object> paramMap);
    
    /**
     * 查询单个商品库存
     * @param stock
     * @return GoodsStock
     */
    GoodsStock selectOne(GoodsStock stock);

    int updateGoodsStock(GoodsStock stock);
    
    /**
     * 根据商品ID、规格项查找商品库存
     * @param stock
     * @return
     */
    GoodsStock findGoodsStockByParam(GoodsStock stock);

}